

import soapp
public enum SexType:String{
    case 男 = "1"
    case 女 = "2"
    case 保密 = "0"
    
    public static func new(CName:String)->SexType{
        switch CName {
        case "女":
            return .女
        case "男":
            return .男
        default:
            return .保密
        }
    }
    

    
    public var form_node:[String:Any]{
        get{
            return ["name":self.name,"id":self.rawValue]
        }
    }
    
    public static var options:[[String:Any]]
    {
        get{
            var ops = [[String:Any]]()
            ops.append(SexType.男.form_node)
            ops.append(SexType.女.form_node)
            ops.append(SexType.保密.form_node)
            return ops
        }
    }
    
    public var name:String
    {
        get
        {
            switch self {
            case .保密:
                return "保密"
            case .女:
                return "女"
            default:
                return "男"
            }
        }
    }
}



public struct Tool {
    public enum Month:String{
        case _1 = "Jan"
        case _2 = "Feb"
        case _3 = "Mar"
        case _4 = "Apr"
        case _5 = "May"
        case _6 = "Jun"
        case _7 = "Jul"
        case _8 = "Aug"
        case _9 = "Sep"
        case _10 = "Oct"
        case _11 = "Nov"
        case _12 = "Dec"
        
        static func new(tag:String)->Month{
            switch tag {
            case "01","1":
                return ._1
            case "02","2":
                return ._2
            case "03","3":
                return ._3
            case "04","4":
                return ._4
            case "05","5":
                return ._5
            case "06","6":
                return ._6
            case "07","7":
                return ._7
            case "08","8":
                return ._8
            case "09","9":
                return ._9
            case "10":
                return ._10
            case "11":
                return ._11
            case "12":
                return ._12
            default:
                return ._1
            }
            
        }
        
        
    }
}


